﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace QControlCenter.ViewModel
{

    [ValueConversion(typeof(int), typeof(string))]
    public class DeviceManagerSvgConvert : IValueConverter
    {
        public static string[] DeviceStatus = new string[]
        {
            "/images/weiyunxing.svg",
            "/images/yunxingzhong.svg",
            "/images/guzhang.svg"
        };
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            int index=System.Convert.ToInt32(value);
            return DeviceStatus[index];
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }



	[ValueConversion(typeof(int), typeof(bool))]
    public class DeviceManagerInt2BoolConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if(value is true)
            {

            }
            var val_0=System.Convert.ToInt32(value);
            var val_1 = System.Convert.ToInt32(parameter);
            return val_0==val_1;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {

            return parameter;
        }
    }



}
